{% load static %}
{% load i18n %}
<div class="layui-header layui-fluid">
    <div class="" style="display:flex;flex-direction:row;justify-content:space-between;">
        <!-- LOGO -->
        <div class="">
            <a class="logo" href="{% url 'pro_list' %}">
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
 width="100%" height="40" viewBox="0 0 572.000000 308.000000"
 preserveAspectRatio="xMidYMid meet">

<g transform="translate(0.000000,308.000000) scale(0.100000,-0.100000)"
fill="#000000" stroke="none">
<path d="M823 2829 c-113 -21 -192 -108 -239 -264 -15 -49 -19 -94 -19 -240 0
-99 4 -201 8 -226 7 -43 11 -47 48 -58 59 -18 184 -86 248 -135 82 -63 175
-167 242 -269 33 -49 59 -83 59 -76 0 8 5 67 10 131 15 185 57 354 130 525 22
51 40 101 40 111 0 24 -81 190 -122 250 -127 188 -269 277 -405 251z"/>
<path d="M1809 2620 c-119 -20 -245 -113 -348 -259 -27 -37 -26 -51 4 -110 70
-140 134 -398 150 -609 l7 -92 61 92 c115 175 288 322 453 384 l76 29 -5 125
c-6 145 -28 228 -82 307 -70 103 -190 154 -316 133z"/>
<path d="M3477 2624 c-4 -4 -7 -47 -7 -96 l0 -88 -204 0 c-173 0 -207 -2 -220
-16 -14 -13 -16 -52 -16 -268 0 -186 3 -257 13 -269 10 -15 39 -17 217 -19
l205 -3 3 -147 3 -148 89 0 89 0 3 148 3 147 155 6 c171 6 225 20 257 67 16
24 18 55 21 248 3 194 1 223 -13 238 -14 14 -45 16 -220 16 l-204 0 -3 93 -3
92 -80 3 c-45 1 -84 0 -88 -4z m-7 -469 l0 -195 -140 0 -140 0 0 195 0 195
140 0 140 0 0 -195z m458 14 c-3 -165 -5 -182 -22 -195 -15 -10 -52 -14 -138
-14 l-118 0 0 195 0 195 141 0 140 0 -3 -181z"/>
<path d="M4513 2618 c-5 -7 -16 -29 -23 -48 -55 -143 -157 -329 -245 -449 -36
-48 -45 -69 -45 -101 0 -22 3 -40 6 -40 13 0 123 92 172 144 29 31 55 56 58
56 2 0 4 -137 4 -305 l0 -305 80 0 80 0 0 439 0 438 39 84 c22 46 37 87 35 91
-9 13 -151 9 -161 -4z"/>
<path d="M4817 2624 c-11 -11 -8 -702 3 -773 13 -80 38 -128 88 -173 63 -57
137 -80 279 -86 66 -2 133 -2 147 2 23 6 56 50 56 75 0 6 -47 9 -117 9 -145 0
-196 12 -244 60 -42 42 -59 103 -59 206 l0 63 65 18 c113 30 225 118 288 226
22 38 77 169 77 185 0 2 -37 4 -81 2 l-81 -3 -26 -70 c-13 -38 -39 -92 -57
-120 -53 -83 -168 -174 -180 -143 -3 7 -6 128 -7 268 l-3 255 -70 3 c-39 1
-74 0 -78 -4z"/>
<path d="M1373 2189 c-37 -84 -82 -234 -104 -349 -50 -260 -12 -592 78 -692
18 -20 54 -23 84 -8 26 15 65 94 83 171 31 138 40 255 27 378 -20 191 -72 397
-128 506 l-20 39 -20 -45z"/>
<path d="M333 2000 c-131 -27 -202 -116 -203 -256 -1 -248 235 -572 505 -695
197 -89 446 -107 536 -38 l24 19 -30 0 c-54 1 -165 63 -248 139 -48 43 -152
182 -196 259 -83 147 -135 287 -175 462 l-23 105 -39 7 c-50 9 -98 8 -151 -2z"/>
<path d="M2300 2002 c-28 -6 -36 -12 -38 -32 -7 -52 -53 -222 -81 -297 -42
-114 -112 -252 -173 -340 -113 -164 -287 -302 -383 -303 l-30 0 24 -19 c39
-30 91 -41 193 -41 215 0 434 95 591 257 124 127 209 267 242 398 32 127 10
251 -56 312 -57 52 -195 83 -289 65z"/>
<path d="M600 1966 c0 -3 7 -35 15 -71 38 -163 103 -328 181 -458 63 -104 160
-221 176 -211 5 3 7 1 6 -5 -4 -14 109 -98 149 -112 18 -6 43 -9 55 -7 22 3
23 7 22 88 -1 57 -9 107 -23 150 -28 84 -106 240 -136 272 -13 14 -22 28 -19
30 8 9 -162 182 -221 223 -85 61 -205 119 -205 101z"/>
<path d="M2094 1932 c-93 -50 -156 -97 -230 -174 -78 -81 -110 -124 -167 -223
-71 -122 -109 -241 -111 -345 l-1 -85 42 1 c92 2 247 139 360 319 66 104 171
355 157 376 -3 5 -1 9 4 9 5 0 15 26 21 58 6 31 14 67 17 80 9 31 -8 28 -92
-16z"/>
<path d="M3392 1388 c-17 -17 -15 -47 3 -54 23 -9 62 4 69 22 13 35 -44 60
-72 32z"/>
<path d="M4436 1343 c-3 -32 -19 -112 -35 -178 l-28 -120 26 -6 c40 -8 48 -1
62 54 19 83 38 123 65 137 40 22 47 3 29 -74 -18 -76 -13 -104 18 -115 32 -12
47 -2 47 31 0 17 7 56 15 88 18 68 9 104 -30 122 -19 9 -33 8 -63 -4 l-38 -15
4 55 c4 45 1 58 -14 69 -37 27 -51 17 -58 -44z"/>
<path d="M3143 1279 c-76 -22 -79 -94 -7 -138 69 -41 51 -83 -26 -61 -49 14
-60 13 -60 -9 0 -24 46 -41 112 -41 39 0 54 5 73 25 47 46 28 102 -45 140 -43
22 -37 51 10 49 19 -1 44 -3 55 -5 12 -3 21 2 23 13 2 12 -7 20 -35 27 -44 13
-56 13 -100 0z"/>
<path d="M3637 1280 c-16 -5 -34 -14 -41 -20 -10 -8 -15 -7 -20 5 -3 9 -18 15
-36 15 -27 0 -30 -3 -30 -32 0 -18 -9 -71 -20 -116 -11 -46 -18 -87 -16 -91 5
-7 65 -6 70 1 2 1 10 35 19 73 19 80 44 118 77 123 25 4 25 5 4 -134 -7 -49
11 -74 50 -67 14 3 24 9 21 13 -3 5 2 40 10 80 8 39 15 81 15 94 0 48 -47 73
-103 56z"/>
<path d="M3905 1280 c-76 -23 -130 -126 -101 -194 20 -48 85 -72 147 -56 116
31 170 180 85 235 -31 21 -91 27 -131 15z m86 -61 c23 -43 -29 -149 -73 -149
-9 0 -25 11 -33 24 -32 48 16 146 70 146 15 0 29 -8 36 -21z"/>
<path d="M4230 1280 c-70 -17 -123 -115 -100 -186 15 -45 45 -64 101 -64 60 0
79 7 79 31 0 16 -5 18 -25 13 -14 -3 -36 -3 -50 0 -32 8 -42 59 -22 109 19 43
46 59 95 55 28 -2 38 1 40 14 2 9 -1 18 -5 21 -18 11 -80 15 -113 7z"/>
<path d="M4807 1276 c-69 -25 -107 -80 -107 -154 0 -56 42 -92 108 -92 66 0
92 9 92 31 0 16 -6 17 -51 12 -43 -5 -54 -3 -65 12 -24 32 -16 42 37 47 61 6
100 33 113 77 8 26 6 36 -10 51 -27 25 -72 32 -117 16z m61 -46 c4 -24 -20
-49 -55 -56 -27 -5 -33 -3 -33 10 0 24 47 68 68 64 9 -2 18 -10 20 -18z"/>
<path d="M5135 1283 c-11 -3 -27 -11 -36 -19 -14 -13 -18 -12 -29 1 -7 8 -22
15 -34 15 -19 0 -23 -12 -44 -118 -12 -64 -22 -120 -22 -123 0 -3 17 -3 37 0
37 6 37 7 50 70 15 75 47 131 74 131 25 0 25 -31 0 -128 l-18 -73 40 3 41 3
17 68 c18 71 41 114 65 124 30 11 35 -12 18 -85 -15 -65 -15 -74 -1 -96 12
-17 22 -22 40 -19 26 5 25 0 43 164 6 51 4 58 -17 73 -30 21 -46 20 -91 -3
-30 -15 -39 -16 -50 -5 -16 16 -56 24 -83 17z"/>
<path d="M3365 1268 c-16 -45 -52 -224 -47 -229 4 -4 21 -5 38 -2 31 5 32 6
58 116 14 62 26 115 26 120 0 12 -70 8 -75 -5z"/>
<path d="M1960 470 l0 -100 -40 0 c-33 0 -40 -3 -40 -20 0 -17 7 -20 40 -20
l40 0 0 -40 c0 -33 3 -40 20 -40 17 0 20 7 20 40 0 36 2 40 26 40 33 0 30 33
-4 38 -21 3 -22 7 -22 103 0 92 -1 99 -20 99 -19 0 -20 -7 -20 -100z"/>
<path d="M1783 547 c-32 -7 -53 -16 -53 -24 0 -7 9 -13 19 -13 19 0 35 -23 24
-34 -4 -3 -15 -6 -25 -6 -10 0 -18 -7 -18 -15 0 -8 7 -15 15 -15 19 0 19 -37
0 -70 -8 -14 -14 -34 -15 -44 0 -18 1 -18 20 -1 20 18 20 17 20 -28 0 -40 3
-47 20 -47 18 0 20 7 20 55 0 59 1 60 31 45 26 -15 26 13 -1 47 -11 14 -20 30
-20 34 0 5 9 9 20 9 27 0 25 28 -2 32 -33 4 -35 35 -4 49 14 7 26 18 26 26 0
14 -2 14 -77 0z"/>
<path d="M2760 551 c0 -6 5 -13 10 -16 6 -3 10 -13 10 -21 0 -11 -6 -13 -20
-9 -17 6 -20 2 -20 -29 0 -29 4 -36 20 -36 11 0 20 7 20 15 0 12 18 15 105 15
87 0 105 -3 105 -15 0 -8 9 -15 20 -15 16 0 20 7 20 35 0 31 -3 35 -25 35 -22
0 -24 3 -15 19 14 28 13 31 -13 31 -16 0 -26 -9 -33 -28 -14 -37 -43 -37 -56
0 -6 17 -17 28 -29 28 -21 0 -25 -20 -8 -37 8 -8 8 -13 0 -17 -15 -10 -31 2
-41 30 -9 23 -50 35 -50 15z"/>
<path d="M4857 553 c-4 -3 -7 -64 -7 -135 l0 -128 -60 0 c-47 0 -60 -3 -60
-15 0 -13 24 -15 155 -15 129 0 155 2 155 15 0 11 -16 15 -67 17 l-68 3 -3 68
-3 67 61 0 c47 0 60 3 60 15 0 12 -13 15 -60 15 l-60 0 0 50 c0 42 -3 50 -18
50 -10 0 -22 -3 -25 -7z"/>
<path d="M3740 535 c0 -10 10 -15 29 -15 40 0 45 -13 16 -40 -14 -13 -25 -32
-25 -43 0 -17 5 -18 77 -11 43 4 90 10 105 15 19 5 28 3 32 -7 6 -15 46 -20
46 -5 0 13 -40 61 -51 61 -6 0 -17 -7 -25 -15 -10 -9 -34 -15 -65 -15 l-50 0
21 30 c21 29 24 30 101 30 64 0 79 3 79 15 0 13 -23 15 -145 15 -122 0 -145
-2 -145 -15z"/>
<path d="M1886 526 c3 -8 17 -22 30 -31 23 -15 24 -14 24 5 0 13 -10 24 -26
30 -33 13 -34 13 -28 -4z"/>
<path d="M1384 405 c0 -66 1 -92 3 -57 2 34 2 88 0 120 -2 31 -3 3 -3 -63z"/>
<path d="M2384 405 c0 -66 1 -92 3 -57 2 34 2 88 0 120 -2 31 -3 3 -3 -63z"/>
<path d="M3384 405 c0 -66 1 -92 3 -57 2 34 2 88 0 120 -2 31 -3 3 -3 -63z"/>
<path d="M4384 405 c0 -66 1 -92 3 -57 2 34 2 88 0 120 -2 31 -3 3 -3 -63z"/>
<path d="M5384 415 c0 -55 1 -76 3 -47 2 29 2 74 0 100 -2 26 -3 2 -3 -53z"/>
<path d="M1886 453 c-11 -11 -6 -19 24 -36 29 -18 30 -18 30 1 0 19 -43 46
-54 35z"/>
<path d="M2800 425 c0 -11 12 -15 45 -15 25 0 45 -4 45 -8 0 -21 -29 -32 -87
-32 -49 0 -63 -3 -63 -15 0 -12 13 -15 60 -15 l60 0 0 -30 c0 -23 -4 -30 -20
-30 -11 0 -20 -7 -20 -15 0 -10 11 -15 35 -15 38 0 55 20 55 64 0 25 2 26 65
26 51 0 65 3 65 15 0 12 -14 15 -62 15 l-63 1 28 20 c50 38 36 49 -58 49 -69
0 -85 -3 -85 -15z"/>
<path d="M3860 395 c0 -11 -12 -15 -45 -15 -39 0 -45 -3 -45 -21 0 -19 5 -21
45 -17 43 3 45 2 45 -24 0 -28 -1 -28 -65 -28 -51 0 -65 -3 -65 -15 0 -13 24
-15 155 -15 131 0 155 2 155 15 0 12 -14 15 -65 15 -62 0 -65 1 -65 24 0 23 5
25 48 28 34 2 47 7 47 18 0 11 -13 16 -47 18 -34 2 -48 7 -48 18 0 8 -10 14
-25 14 -16 0 -25 -6 -25 -15z"/>
</g>
</svg>

            </a>
        </div>
        <!-- 搜索框 -->
        <div style="margin:12px;" class="layui-hide-xs">
            {% if search_type == '1' %}
            <form method="get" action="{% url 'doc_search' %}" target="_blank">
                <div class="layui-input-inline">
                    <input class="layui-input mrdoc-search-input" placeholder="{% trans '搜索文档' %}" name="q"/>
                    <button type="submit" style="position: absolute;top:12px;right: 8px;border: none;background-color: white;">
                        <i class="layui-icon layui-icon-search" ></i>
                    </button>
                </div>
            </form>
            {% else %}
            <form method="get" action="{% url 'search' %}" target="_blank">
                <input name="type" value="doc" hidden />
                <div class="layui-input-inline">
                    <input class="layui-input mrdoc-search-input" placeholder="{% trans '搜索文档' %}" name="kw"/>
                    <button type="submit" style="position: absolute;top:12px;right: 8px;border: none;background-color: white;">
                        <i class="layui-icon layui-icon-search" ></i>
                    </button>
                </div>
            </form>
            {% endif %}
        </div>
        <div class="layui-hide-lg layui-hide-md layui-hide-sm" style="margin:20px;padding-left:60px;">
            <a href="{% url 'search' %}">
                <i class="layui-icon layui-icon-search" style="font-size: 24px;"></i>
            </a>
        </div>
        
        <!-- 新建文档按钮 -->
        {% if request.user.is_authenticated %}
        <div class="layui-hide-xs">
            <ul class="layui-nav">
                <li class="layui-nav-item">
                    <a>
                        <i class="layui-icon layui-icon-add-circle" style="color:black;"></i> <span>{% trans "新建" %}</span>
                    </a>
                    <dl class="layui-nav-child">
                        <dd>
                            <a href="{% url 'create_doc' %}">
                                <img src="{% static 'icon_img/create-doc-icon.svg' %}" height="14px" width="14px"></img>
                                <span class="layui-hide-xs">{% trans "新建文档" %}</span>
                            </a>
                        </dd>
                        <dd>
                            <a href="{% url 'create_doc' %}?eid=4">
                                <img src="{% static 'icon_img/create-table-icon.svg' %}" height="14px" width="14px"></img>
                                <span class="layui-hide-xs">{% trans "新建表格" %}</span>
                            </a>
                        </dd>
                        <dd>
                            <a href="javascript:void(0);" onclick="createPro();">
                                <img src="{% static 'icon_img/create-pro-icon.svg' %}" height="14px" width="14px"></img>
                                <span class="layui-hide-xs">{% trans "新建文集" %}</span>
                            </a>
                        </dd>
                    </dl>
                </li>
            </ul>
        </div>
        {% endif %}
        <!-- 用户菜单 -->
        <div class="">
            <ul class="layui-nav layui-layout-right">
                {% if request.user.is_authenticated %}
            <li class="layui-nav-item">
                <a href="javascript:void(0);">
                    <i class="layui-icon layui-icon-friends"></i> 
                    <span class="layui-hide-xs">{% if request.user.first_name != '' %} {{request.user.first_name}} {% else %} {{request.user.username}}{% endif %}</span>
                </a>
                <dl class="layui-nav-child">
                    {% if request.user.is_superuser %}
                    <dd>
                        <a href="{% url 'admin_center' %}" title="进入站点后台管理">
                            <i class="layui-icon layui-icon-console layui-hide-md"></i>
                            <span class="layui-hide-xs">{% trans "进入后台" %}</span>
                        </a>
                    </dd>
                    {% endif %}
                    <dd class="layui-hide-md layui-hide-sm layui-hide-lg">
                        <a href="{% url 'create_doc' %}" title="新建文档">
                            <i class="layui-icon layui-icon-add-1 layui-hide-md"></i>
                            <span class="layui-hide-xs">{% trans "新建文档" %}</span>
                        </a>
                    </dd>
                    <dd>
                        <a href="{% url 'user_center' %}" title="个人中心">
                            <i class="layui-icon layui-icon-app layui-hide-md"></i>
                            <span class="layui-hide-xs">{% trans "个人中心" %}</span>
                        </a>
                    </dd>
                    <dd>
                        <a href="javascript:void(0);" onclick="changePwd('{{ request.user.id }}','{{ request.user.username }}' )" title="修改登录密码">
                            <i class="layui-icon layui-icon-password layui-hide-md"></i>
                            <span class="layui-hide-xs">{% trans "修改密码" %}</span>
                        </a>
                    </dd>
                    <dd>
                        <a href="javascript:void(0)" title="退出登录" onclick="Logout()">
                            <i class="layui-icon layui-icon-logout layui-hide-md"></i>
                            <span class="layui-hide-xs">{% trans "退出登录" %}</span>
                        </a>
                    </dd>
                </dl>
            </li>
                {% else %}
                <li class="layui-nav-item">
                <a href="javascript:void(0);">
                <i class="layui-icon layui-icon-username"></i>
                    <span class="layui-hide-xs">{% trans "游客" %}</span>
                </a>
                <dl class="layui-nav-child">
                    {% if close_register == 'on' %}
                    <dd>
                        <a href="{% url 'login' %}">
                            <i class="iconfont mrdoc-icon-denglu"></i>
                            {% trans "登录" %}
                        </a>
                    </dd>
                    {% else %}
                    <dd>
                        <a href="{% url 'register' %}">
                            <i class="iconfont mrdoc-icon-zhuce"></i>
                            {% trans "注册" %}
                        </a>
                    </dd>
                    <dd>
                        <a href="{% url 'login' %}">
                            <i class="iconfont mrdoc-icon-denglu"></i>
                            {% trans "登录" %}
                        </a>
                    </dd>
                    {% endif %}
                </dl>
            </li>
                {% endif %}
            </ul>
        </div>
    </div>
</div>
<script>
    function Logout(){
        $.ajax({
            url:"{% url 'logout' %}",
            method:'post',
            success:function(r){
                if(r.status){
                    window.location.href = r.data
                }else{
                    layer.msg("注销失败")
                }
            },
            error:function(){
                layer.msg("注销失败")
            }
        })
    }
</script>